// src/mock/authData.js
import { mockDatabase } from '@/mock/modules/user';

// 权限定义
export const PERMISSIONS = {
    DASHBOARD: 'dashboard',
    CASES: 'cases',
    CLIENTS: 'clients',
    SETTINGS: 'settings',
    AICHAT: 'aichat' // 新增AI咨询权限
};

// 所有菜单项配置
export const ALL_MENU_ITEMS = [
    { path: '/dashboard', name: '仪表盘', icon: 'HomeIcon', permCode: PERMISSIONS.DASHBOARD },
    { path: '/cases', name: '案件管理', icon: 'DocumentTextIcon', permCode: PERMISSIONS.CASES },
    { path: '/clients', name: '用户管理', icon: 'UserGroupIcon', permCode: PERMISSIONS.CLIENTS },
    { path: '/settings', name: '系统设置', icon: 'CogIcon', permCode: PERMISSIONS.SETTINGS },
    { path: '/aichat', name: 'AI咨询', icon: 'ChatIcon', permCode: PERMISSIONS.AICHAT } // 新增AI咨询菜单项
];

// 用户类型权限映射
export const ROLE_PERMISSIONS = {
    admin: [PERMISSIONS.DASHBOARD, PERMISSIONS.CASES, PERMISSIONS.CLIENTS, PERMISSIONS.SETTINGS, PERMISSIONS.AICHAT],
    public: [PERMISSIONS.DASHBOARD, PERMISSIONS.AICHAT], // 公众用户增加AI咨询权限
    lawyer: [PERMISSIONS.DASHBOARD, PERMISSIONS.CASES, PERMISSIONS.AICHAT] // 律师用户增加AI咨询权限
};

// 权限数据模型
export const PERMISSION_MODEL = {
    id: { type: 'number', required: true },
    perm_name: { type: 'string', required: true },
    perm_code: { type: 'string', required: true },
    perm_desc: { type: 'string' }
};

export default {
    // 使用mockDatabase中的用户数据
    get users() {
        return mockDatabase.users;
    },
    PERMISSIONS,
    ALL_MENU_ITEMS,
    ROLE_PERMISSIONS,
    PERMISSION_MODEL
};